package work.jame.blog.controller;


import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;
import work.jame.blog.framework.result.Result;
import work.jame.blog.pojo.Bulletin;
import work.jame.blog.service.BulletinService;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Jame
 * @since 2023-05-18
 */
@Api(tags = "公告")
@RestController
@RequestMapping("/bulletin")
public class BulletinController {

    @Autowired
    private BulletinService bulletinService;

    @PostMapping("/save")
    public Result<?> saveBulletin(@RequestBody Bulletin bulletin) {
        if (bulletinService.save(bulletin)) {
            return Result.succeed();
        }
        return Result.fail();
    }

}
